Processing method, processing apparatus, and electronic device

ABSTRACT

The present disclosure provides a processing method, a processing apparatus, and an electronic device. The method includes identifying a connection relationship, from two or more candidate connection relationships, that matches a plug connect between a first port of an external device and a second port of an electronic device, in response to detecting a plug connect between the first port and the second port; based on the connection relationship, identifying a control command corresponding to the connection relationship, each candidate connection relationship corresponding to a different control command; and responding to the control command.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application claims the priority to Chinese Patent Application No.201810001472.7, entitled “Processing Method and Apparatus, and anElectronic Device thereof,” filed on Jan. 2, 2018, the entire content ofwhich is incorporated herein by reference.

FIELD OF TECHNOLOGY

The present disclosure relates to the field of control, and morespecifically, relates to a processing method, a processing apparatus,and an electronic device.

BACKGROUND

Currently, additional software controls are needed to expand thefunctionalities of devices connected to an electronic device throughconnection ports. However, these additional software controls mayincrease the complexity of user operation, hence lower the userexperience.

BRIEF SUMMARY OF THE DISCLOSURE

One aspect of the present disclosure provides a processing method,including: identifying a connection relationship, from two or morecandidate connection relationships, that matches a plug connect betweena first port of an external device and a second port of an electronicdevice, in response to detecting a plug connect between the first portand the second port; based on the connection relationship, identifying acontrol command corresponding to the connection relationship, eachcandidate connection relationship corresponding to a different controlcommand; and responding to the control command.

Another aspect of the present disclosure provides an electronic device.The electronic device includes an electronic device port capable ofconnecting to a first port on an external device and a processor. Theprocessor is configured to identify a connection relationship, from twoor more candidate connection relationships, that matches a plug connectbetween the first port and the electronic device port, in response todetecting a plug connect between the first port and the second port,identify a control command corresponding to the connection relationship,each candidate connection relationship corresponding to a differentcontrol command; and respond to the control command.

Another aspect of the present invention provides a processing apparatus.The processing apparatus includes at least one processor, configured to:identify a connection relationship, from two or more candidateconnection relationships, that matches a plug connect between the firstport and the electronic device port, in response to detecting a plugconnect between the first port and the second port, identify a controlcommand corresponding to the connection relationship, each candidateconnection relationship corresponding to a different control command;and respond to the control command.

Other aspects of the present disclosure can be understood by thoseskilled in the art in light of the description, the claims, and thedrawings of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present disclosure, and theadvantages thereof, reference is now made to the following descriptionsto be taken in conjunction with the accompanying drawings. Theaccompanying drawings in the following description show merely someembodiments of the present invention, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a flowchart illustrating a processing method according to anembodiment of the present disclosure;

FIG. 2 is a flowchart illustrating a processing method according toanother embodiment of the present disclosure;

FIG. 3 is a flowchart illustrating a processing method according to yetanother embodiment of the present disclosure;

FIG. 4 is a block diagram illustrating the structure of an electronicdevice an embodiment of the present disclosure; and

FIG. 5 is a block diagram illustrating the structure of a processingapparatus according to an embodiment of the present disclosure.

DETAILED DESCRIPTION

Hereinafter, aspects, features, and embodiments of the presentdisclosure will be described with reference to the accompanyingdrawings. It should be understood that such description is exemplaryonly but is not intended to limit the scope of the present disclosure.In addition, it will be understood by those skilled in the art thatvarious modifications in form and details may be made therein withoutdeparting from the spirit and scope of the present disclosure.

The accompanying drawings illustrating embodiments of the presentdisclosure along with the summary of disclosure provided above and thedetailed description provided below serve to explain the concepts of thepresent disclosure.

Features and aspects of the present disclosure will become apparent withreference to the accompanying drawings and non-limiting examplesdescribing various preferred embodiments of the present disclosure.

It will also be appreciated that although the present disclosure hasbeen described with reference to some specific examples, equivalents ofthe present disclosure can be achieved by those skilled in the art.These equivalents having features claimed in the present disclosureshould fall within the scope of protection defined hereinafter.

Hereinafter, embodiments of the present disclosure will be describedwith reference to the accompanying drawings. It should be understoodthat such description is exemplary only but is not intended to limit thescope of the present disclosure. In addition, in the followingdescription, descriptions of well-known structures and techniques areomitted to avoid unnecessarily obscuring the concepts of the presentdisclosure. Therefore, specific structural and functional detailsdisclosed herein are not intended to be limiting, but are merely used asa basis of the claims to teach those skilled in the art to use thepresent disclosure in various combinations.

The terms used herein is for the purpose of describing particularembodiments only but is not intended to limit the present disclosure.The words “a”, “an” and “the” as used herein should also cover themeanings of “a plurality of” and “a variety of”, unless the contextclearly dictates otherwise. In addition, the terms “comprising”,“including”, “containing” and the like as used herein indicate thepresence of the features, steps, operations and/or components, but donot preclude the presence or addition of one or more other features,steps, operations or components.

The phrases “in an embodiment”, “in another embodiment”, “in anotherembodiment”, or “in other embodiments” may refer to the same ordifferent embodiments accordingly to the present disclosure.

Embodiments of the present disclosure provide a processing method, aprocessing apparatus, and an electronic device, which can solve theproblems of complicated user operation and poor user experience due tointroducing of additional software controls to expand thefunctionalities of devices connected to an electronic device throughconnection ports.

In one embodiment, the method includes identifying a connectionrelationship, from two or more candidate connection relationships, thatmatches a plug connect between a first port of an external device and asecond port of an electronic device, in response to detecting a plugconnect between the first port and the second port; based on theconnection relationship, identifying a control command corresponding tothe connection relationship, each candidate connection relationshipcorresponding to a different control command; and responding to thecontrol command. The identification of connection relationship betweenthe external device and the electronic device, and the control commandscorresponding to the connection relationship avoids the need ofadditional software controls to enhance the functionalities of theexternal device, thereby simplifying the user operation and enhancinguser experience of the external device or the electronic device undervarious working modes.

FIG. 1 is a flowchart illustrating a processing method according to anembodiment of the present disclosure. The method includes the followingsteps.

In S11, identifying a connection relationship, from two or morecandidate connection relationships, that matches a plug connect betweena first port of an external device and a second port of an electronicdevice, in response to detecting a plug connect between the first portand the second port.

The electronic device may include a second port, and the external devicemay include a first port. The first port may be a plug, and theelectronic device may be connected to the first port of the externaldevice through the second port so the electronic device and the externaldevice may be connected. Further, the first port and the second port mayhave two or more connection relationships.

Two or more potential connection relationships between the first portand the second port may be pre-stored as the candidate connectionrelationships. The candidate connection relationships may be used toidentify the current connection relationship from the two or morecandidate connection relationships in response to detecting the plugconnect between the first port and the second port.

The first port and the second port may be connected in two or morecandidate connection relationships. The two or more candidate connectionrelationships may be a plurality of connection parameters used toidentify the connection relationship. The connection parameters mayindicate the depth, angle, or position of the plug connect between thefirst port and the second port.

When the connection parameters indicate the depth of plug connectbetween the first port and the second port, different connectionparameters may indicate different depths of connection relationships.For example, when the first port is fully connected to the second port,it may be indicated as the first connection parameter. For example, thefirst port may be a plug, and the first port may be fully inserted intothe second port, at this point, the connection relationship correspondsto the first connection parameter may be the first candidate connectionrelationship. That is, the first port and the second port may be in thefirst candidate connection relationship. When the first port is notfully connected to the second port, it may be indicated as the secondconnection parameter. For example, the first port may be a plug, and thefirst port may not be fully inserted into the second port, such as whenthe first port is half-inserted into the second port. At this point, theconnection relationship corresponds to the second connection parametermay be the second candidate connection relationship. That is, the firstport and the second port may be in the second candidate connectionrelationship.

When the connection parameters indicate the angle of the plug connectbetween the first port and the second port, different connectionparameters may indicate different angles of connection relationships.For example, take a predetermined side of the first port from a firstend to a second end as a first reference direction, and a predeterminedside of the second port from a first end to a second end as a secondreference direction. When the angle between the first referencedirection and the second reference direction is 0°, the connectionrelationship between the first port and the second may be the firstcandidate connection relationship. When the angle between the firstreference direction and the second reference direction is 180°, theconnection relationship between the first port and the second may be thesecond candidate connection relationship. For example, the first portmay be a Type C plug, the second port may be a Type C port, and thefirst port may be connected through two or more angles. That is, thefirst surface of the first port and the second surface of the secondport may have two or more angles, such as forward insertion and reverseinsertion.

The plug connect between the first port and the second port in differentpositions may indicate different connection relationships, andconnection identifiers may be used to indicate the connectionrelationship where connection identifiers in different positions mayindicate different connection relationships. The second port may beconnected to the first port in a finite number of relative locations.Identify the relative location of the plug connect between the firstport and the second port may identify the connection relationshipcorresponding relative location of the connection of the two or morecandidate connection relationships.

For example, the first port may be a plug, the second port may be aslot, and the second port may be connected to the first port in a finitenumber of relative locations. Because the plug and slot of the existinguniversal 3.5 mm earphone may be rotated at any angle, the relativelocation is infinite. Due to the infinite number of angles or positions,the user cannot accurately insert the plug at a specified angle orposition. Therefore, the preferred port is a port with a finite numberof insertion positions.

On the basis of this understanding, the first port may be a Type A plugand the second port may be an unconventional Type A slot. The first portmay be inserted into the second port through forward and reverseinsertion. That is, the second port may be connected to the first portin two different relative locations. The first port may also be a microUSB plug, and the second port may be an unconventional micro USB slot.The first port may be inserted into the second port through forward andreverse insertion. Further, the first port may also be a Type C plug,and the second portion may be a Type C slot, and the second port may bebi-directionally connected to first port. Furthermore, the first portmay be a Lightening plug, the second port may be a Lightening slot, andthe second port may be bi-directionally connected to first port.

In one embodiment, the first port and the second port may be connectedin two or more connection relationships, and different connectionrelationships may correspond to different control commands. The two ormore connection relationships may correspond to two or more controlcommands; thereby avoid using software control to expand thefunctionalities of the external device.

For example, different connection surfaces may be distinguished bydifferent signs on the plug of the external device. For example, thefirst port of the external device may be a Type C plug. One surface ofthe Type C plug may be coated red and the other surface may be coatedblue to help user distinguish different connection relationships betweenthe first port and the second port.

In S12, based on the connection relationship, identifying a controlcommand corresponding to the connection relationship, wherein eachcandidate connection relationship corresponds to a different controlcommand.

In S13, responding to the control command.

The first port and the second port may be connected in two or morecandidate connection relationships, and different candidate connectionrelationships may correspond to different control commands. That is, thefirst port and the second port may be connected in a first connectionrelationship which corresponds to a first control command, or the firstport and the second port may be connected in a second connectionrelationship which corresponds to a second control command.

For example, when the connection relationship is identified to be thefirst connection relationship in the two or more candidate connectionrelationships, identify the first control command, where the firstcontrol command may place the electronic device or the external deviceunder a first working mode. Further, when the connection relationship isidentified to be the second connection relationship in the two or morecandidate connection relationships, identify the second control command,where the second control command may place the electronic device or theexternal device under a second working mode.

In one embodiment, every connection relationship may correspond to adifferent control command. When the connection relationship between thefirst port and the second port is the first connection relationship inthe two or more connection relationships, identify the first controlcommand based on the first connection relationship. When the connectionrelationship between the first port and the second port is the firstconnection relationship, the process may indicate the first controlcommand that need to be executed corresponding to the first connectionrelationship, respond to the first control command, and place theelectronic device or the external device under the first working mode.When the connection relationship between the first port and the secondport is the second connection relationship, the process may indicate thesecond control command that need to be executed corresponding to thesecond connection relationship, respond to the second control command,and place the electronic device or the external device under the secondworking mode.

In one embodiment, working modes may be the working modes of theelectronic device, the working modes of the external device, or theworking modes of both the electronic device and the external device.

In one embodiment, working modes may include power consumption modes,output modes, and may also include function modes.

For example, the first control command may place the electronic deviceunder a first power consumption mode, and the second control command mayplace the electronic device under a second power consumption mode; thefirst control command may place the electronic device under a firstoutput mode, and the second control command may place the electronicdevice under a second output mode; and the first control command mayplace the electronic device under a first function mode, and the secondcontrol command may place the electronic device under a second functionmode.

Further, the first control command may place the external device under afirst power consumption mode, and the second control command may placethe external device under a second power consumption mode; the firstcontrol command may place the external device under a first output mode,and the second control command may place the external device under asecond output mode; and the first control command may place the externaldevice under a first function mode, and the second control command mayplace the external device under a second function mode.

Furthermore, the first control command may place both the electronicdevice and the external device under a first power consumption mode, andthe second control command may place both the electronic device and theexternal device under a second power consumption mode; the first controlcommand may place both the electronic device and the external deviceunder a first output mode, and the second control command may place boththe electronic device and the external device under a second outputmode; and the first control command may place both the electronic deviceand the external device under a first function mode, and the secondcontrol command may place both the electronic device and the externaldevice under a second function mode.

The electronic device's working mode may be the power consumption mode,and the first port and the second port may be connected in the firstcandidate connection relationship. A power consumption device may switchfrom the first working mode to the second working mode after a firsttime period. Further, the first port and the second port may beconnected in the second candidate connection relationship. The powerconsumption device may switch from the first working mode to the secondworking mode after a second time period. The power consumption in thefirst working mode may be greater than the power consumption in thesecond working mode, and the first time period may be longer than thesecond time period.

For example, the power consumption device may be a monitor, and theexternal device may be a headset. The headset may connect to theelectronic through forward insertion, the monitor of the electronicdevice may stay lit for the first 2 minutes, then monitor may shut offafter 2 minutes. That is, the first port and the second port may beconnected in the first candidate connection relationship for 2 minutes,and the electronic device may switch from the first working mode to thesecond working mode. The headset may connect to the electronic throughreverse insertion, and the monitor of the electronic device may shut offimmediately. That is, the first port and the second port may beconnected in the second candidate connection relationship, and theelectronic device may directly switch to the second working mode.Compared with the first candidate connection relationship, theelectronic device connected to the headset in the second candidateconnection relationship may reduce the power consumption of the monitor.

The external device's working mode may be the power consumption mode,the first port and the second port may be connected in the firstcandidate connection relationship, and the external device may be placedunder a first power consumption mode. Further, the first port and thesecond port may be connected in the second candidate connectionrelationship, and the external device may be placed under a second powerconsumption mode. Furthermore, the power consumption in the first powerconsumption mode may be greater than the second power consumption mode.

For example, the external device may be a mobile power source, the firstport may be a plug, and the second port may be a slot. When plug isfully inserted into the slot, the mobile power source may fast chargethe electronic device, that is, the external device may be placed underthe first power consumption mode. Further, when the plug is not fullyinserted into the slot, for example, the plugs may be half-inserted orinserted 2/3 into the slot, the mobile power source may slow charge theelectronic device, that is, the external device may be placed under thesecond power consumption mode.

The electronic device's working mode may be the function mode, the firstport and the second port may be connected in the first candidateconnection relationship, and the electronic device may be under a firstfunction mode. Further, the first port and the second port may beconnected in the second candidate connection relationship, and theelectronic device may be under a second function mode.

For example, the external device may be a data cable, and the electronicdevice may be a mobile phone. When the first port is connected to thesecond port through forward insertion, the external device may chargethe electronic device and maintain the brightness of the monitor of theelectronic device. When the first port is connected to the second portthrough reverse insertion, the external may transmit data to theelectronic device and the monitor of the electronic device may shut off.

The electronic device and the external device's working mode may be thepower consumption mode, the first port and the second port may beconnected in the first candidate connection relationship, and theelectronic device and the external device may be under a first powerconsumption mode simultaneously. Further, the first port and the secondport may be connected in the second candidate connection relationship,and the electronic device and the external device and may be under asecond power consumption mode simultaneously. Furthermore, the powerconsumption in the first power consumption mode may be greater than thesecond power consumption mode.

For example, the external device may be a headset. When the first portis connected to a first second-port, the monitor of the electronicdevice may be in the high brightness mode, and the headset may be in thehigh volume mode. When the first port is connected to a secondsecond-port, the monitor of the electronic device may be in the lowbrightness mode, and the headset may be in the low volume mode.

The working modes may be the output modes.

In one embodiment, the external device may be a multimedia outputdevice, the first working mode may be the external device's first outputmode, and the second working mode may be external device's second outputmode.

In one embodiment, the multimedia output device may be a headset or adisplay. When the external device is a headset, its working modes mayinclude a first audio output mode, a second audio output mode, etc. Thefirst audio output mode may be an audio output mode that meets a firstaudio output condition where the first audio output condition may be thesurrounding sound less than 30 decibels, that is, the surrounding may bein a quite state, the audio output mode may be a mode that correspondsto the first audio output condition, such as a low volume mode. Further,the first audio output condition may be a condition where the audiotransmitted corresponds to the audio output of the external device,which may be soothing or intense. Further, the first audio outputcondition may be a output mode that strengthens the midrange and reducesthe treble and bass, and a second audio output condition may be a outputmode that strengthens the treble and lower the midrange and bass. Forexample, when making a call using the headset, the first audio outputmode may be used to enhance the frequency band in which the user isspeaking and reduce the sound of other frequency bands; when using theheadset to listen to music, the second audio output mode may be used toenhance the high-pitched music the user often listen to and reduce thebass and midrange music the user may not often listen to.

In one embodiment, the external device may be a display, and its workingmodes may include a first image output mode, a second image output mode,etc. The first image output mode may be a color image output mode, suchas when output a video or a picture. The second image output mode may bea black and white image output mode, such as when output a text documentor an electronic book. Alternatively, the image output mode may be amode that transmits images corresponding to the ambient lights orbrightness of the context of images being transmitted, such as whenplaying a horror movie, the first image output mode may be used totransmit darker images.

In one embodiment, the external device may be a multimedia acquisitiondevice, the first working mode may be a first acquisition mode, and thesecond working mode may be a second acquisition mode.

In one embodiment, the multimedia device may be a microphone or an imageacquisition device. The external device may be a microphone, and itsworking modes may include a first audio acquisition mode, a second audioacquisition mode, etc. For example, the first audio acquisition mode maybe a noise reduction acquisition mode, and the second audio acquisitionmode may be a non-noise reduction acquisition mode.

In one embodiment, the external device may be an image acquisitiondevice and its working modes may include a first image acquisition mode,a second image acquisition mode, etc. For example, the first imageacquisition mode may be a high saturation acquisition mode, the secondimage acquisition mode may be a low saturation acquisition mode, etc.

In one embodiment, the external device may be a headset, which may be adevice with a microphone and an earphone, and its working mode, and itsworking modes may include a first working mode for voice sound effectwith noise reduction, and a second working mode for musical sound effectwithout noise reduction.

In one embodiment, the external device may be a storage device, theelectronic device's first working mode may be a mode with a first readaccess, and its second working mode may be a mode with a second readaccess. For example, the first working mode may be a working mode thatallows the external device to access all data, and the second workingmode may be a working mode that allows the external device to accesspartial non-critical data. The electronic device may further include athird working mode where the third working mode a working mode that doesnot allow the external device to access any data. For example, the firstport may need to be inserted into 3 second ports in a predeterminedsequence to prevent unauthorized users from stealing data fromelectronic devices.

Further, the external device's first working mode may be a working modethat allows the electronic device to access data in the external device,and the second working mode may be a working mode that does not allowthe electronic device to access data in the external device. Theelectronic device may only access data in the external device when thefirst port and the second port are connected in the first connectionrelationship to prevent illegal access of data from the external device.

In one embodiment, the external device may be a storage device, theelectronic device's first working mode may be a mode with a first writeaccess, and its second working mode may be a mode with a second writeaccess. For example, the first working mode may be a working mode thatallows the external device to write data, and the second working modemay be a working mode that does not allow the external device to writedata. The external device may only write data into the electronic devicewhen the first port and the second port are connected in the firstconnection relationship to prevent the electronic device when from virusattacks.

In one embodiment, the external device's first working mode may be aworking mode that allows the electronic device to write data into theexternal device, and its second working mode may be a working mode thatdoes not allow the electronic device to write data into the externaldevice. The electronic device may only write data into the externaldevice when the first port and the second port are connected in thefirst connection relationship to prevent the external device when fromvirus attacks.

In one embodiment, when the electronic device or external device isunder the second working mode and the connection relationship matchesthe first connection relationship, upon receiving a second mode switchinstruction to switch the electronic device or external device from thesecond working mode to the first working mode, the electronic device orthe external device may respond to the second mode switch instruction.Further, when the electronic device or external device is under thefirst working mode and the connection relationship matches the secondconnection relationship, upon receiving a first mode switch instructionto switch the external device or electronic device from the firstworking mode to the second working mode, the electronic device or theexternal device may respond to the second mode switch instruction.

That is, when the electronic device or the external device is under thesecond working mode, the connection relationship of the electronicdevice or the external device may switch from the second connectionrelationship to the first connection relationship, and the electronicdevice or the external may switch from the second working mode to thefirst working mode based on the second mode switch instruction. Further,when the electronic device or the external device is under the firstworking mode, the connection relationship of the electronic device orthe external device may switch from the first connection relationship tothe second connection relationship, and the electronic device or theexternal may switch from the first working mode to the second workingmode based on the first mode switch instruction.

In one embodiment, upon receiving a first mode switch instruction toswitch the external device or electronic device from the first workingmode to the second working mode, and the connection relationship matchesthe first connection relationship, the electronic device or the externaldevice may respond to the first mode switch instruction. Further, uponreceiving a second mode switch instruction to switch the external deviceor electronic device from the second working mode to the first workingmode, and the connection relationship matches the second connectionrelationship, the electronic device or the external device may respondto the second mode switch instruction.

For example, the external device may be a display device, the firstconnection relationship may correspond to a first image output mode, andthe second connection relationship may correspond to a second imageoutput mode. While the external device and the electronic device areunder the first connection relationship, video files may be transmittedthrough the external device and the electronic device. Upon thecompletion of the output of the video files, when text files need to betransmitted, the second mode switch instruction may be used to switchthe working mode. Further, while the external device and the electronicdevice are under the second connection relationship, text files may betransmitted through the external device and the electronic device. Uponthe completion of the output of the text files, when video files need tobe transmitted, the first mode switch instruction may be used to switchthe working mode.

In one embodiment, while the connection relationship is the firstconnection relationship, and the first port and the second port areconnected in the first connection relationship, when a first request isreceived to place the electronic device or the external device under thefirst working mode with adjusted parameters, the parameters in the firstworking mode may be adjusted based on the first request. Upon completingthe data output corresponding to the first request, the parametersadjusted under the first working mode may be adjusted to the originalparameters.

In one embodiment, the electronic device or the external device mayrespond to a first command that may be identified based on the firstconnection relationship when the first port and the second port areconnected in the first connection relationship. When the first port andsecond are in connection relationships other than the first connectionrelationship, the connection relationships other than the firstconnection relationship may correspond to invalid control commands orhave no corresponding control commands, the connection relationshipsother than the first connection relationship may be invalid connections,and do not need to be responded.

The embodiments of the processing method described above may identify aconnection relationship from two or more candidate connectionrelationships between a first port of an external device and a secondport of an electronic device in response to detecting a plug connectbetween the first port and the second port; identify a plurality ofcontrol commands corresponding to the connection relationship; andrespond to the control commands. The identification of connectionrelationship between the external device and the electronic device, andthe control commands corresponding to the connection relationship avoidsthe need of additional software controls to enhance the functionalitiesof the external device, thereby simplifying the user operation andenhancing user experience of the external device or the electronicdevice under various working modes.

FIG. 2 is a flowchart illustrating a processing method according toanother embodiment of the present disclosure. The method includes thefollowing steps.

In S21, identifying a connection relationship from two or more candidateconnection relationships between a first port of an external device anda second port of an electronic device in response to detecting a plugconnect between the first port and the second port may be based on aone-time plug connect between the first port and the second port, or asequence of a plurality of connections within a timeframe between thefirst port and the second port.

In one embodiment, the two or more candidate connection relationshipsmay include a one-time plug connect between the first port and thesecond port. For example, the first port and the second port only needto connect once to establish the connection relationship, and theworking mode may be identified based on the established connectionrelationship.

In one embodiment, the two or more candidate connection relationshipsmay include a sequence of connection relationships obtained from aplurality of connections within a timeframe between the first port andthe second port. For example, the first port and the second port mayconnect two or more times within a timeframe, the first connect may be afirst connection relationship, the second connect may be a secondconnection relationship, the third connect may be a third connectionrelationship, and no more subsequent change in connection relationshipafterward. Accordingly, the connection sequence obtained may be thefirst connection relationship the second connection relationship thefirst connection relationship. Different connection sequences maycorrespond to different control commands; hence correspond to differentworking modes.

In one embodiment, the plurality of connections within a timeframe maybe completing all the connections within the timeframe. Further,identification of the connection relationship sequence may be based on atime interval between 2 connections. When the connection relationshipdoes not change in the time interval, the sequence may be consideredcomplete.

Furthermore, the plurality of connections within a timeframe may be thatthe first port and the second port need to complete two or moreconnections within the timeframe in sequence. For example, the secondport may include a first second-port, a second second-port, and a thirdsecond-port. The first port may connect to the first, second, and thirdsecond-port, and connect to the last second port within the timeframe tocorrespond to a first working mode.

In S22, identifying a plurality of control commands corresponding to theconnection relationship based on the connection relationship, where eachcandidate connection relationship corresponds to different controlcommands.

In S33, responding to the control commands.

The embodiments of the processing method described above may identify aconnection relationship from two or more candidate connectionrelationships between a first port of an external device and a secondport of an electronic device in response to detecting a plug connectbetween the first port and the second port; identify a plurality ofcontrol commands corresponding to the connection relationship; andrespond to the control commands. The identification of connectionrelationship between the external device and the electronic device, andthe control commands corresponding to the connection relationship avoidsthe need of additional software controls to enhance the functionalitiesof the external device, thereby simplifying the user operation andenhancing user experience of the external device or the electronicdevice under various working modes.

FIG. 3 is a flowchart illustrating a processing method according to yetanother embodiment of the present disclosure. The method includes thefollowing exemplary steps.

In S31, identifying a resistance level at the plug connect between afirst port and a second port in response to detecting a plug connectbetween the first port and the second port.

In S32, identifying the connection relationship from two or morecandidate connection relationships based on the resistance level.

In one embodiment, the connection relationship may be identified by theconnection parameters. The connection parameters may be the resistancelevel at the plug connect between the first port and the second port,the voltage at the plug connect between the first port and the secondport, or sensors detected parameters, etc. In this embodiment, theresistance level at plug connect between the first port and the secondport is selected as the connection parameters for further illustration.

The first port and the second port may have two or more candidateconnection relationships, and different candidate connectionrelationships may be identified based on the resistance level at theplug connect between the first port and the second port. That is, thecorresponding candidate connection relationship may be identified basedon different resistance levels at the plug connect between the firstport and the second port that may be connected at different angles ordifferent depths.

For example, the first port may be a Type C plug, the second port may bea Type C slot, and the resistance level at the plug connect between thefirst port and the second port may be different depending on whether theconnection is achieved through forward insertion or reverse insertion.

Further, the connection relationship may be identified from two or morecandidate connection relationships based on the relative location of theplug connect between the first port and the second port. Differentrelative connection positions may correspond to different connectionrelationships, hence, different control commands.

For example, a plurality of sensors may be placed by the connection ofthe second port, and data from different number of sensors maycorrespond to different connection relationships, or data from theplurality of sensors in different positions may correspond to differentconnection relationships.

In S33, identifying a plurality of control commands corresponding to theconnection relationship based on the connection relationship, where eachcandidate connection relationship corresponds to different controlcommands.

In S34, responding to the control commands.

The embodiments of the processing method described above may identify aconnection relationship from two or more candidate connectionrelationships between a first port of an external device and a secondport of an electronic device in response to detecting a plug connectbetween the first port and the second port; identify a plurality ofcontrol commands corresponding to the connection relationship; andrespond to the control commands. The identification of connectionrelationship between the external device and the electronic device, andthe control commands corresponding to the connection relationship avoidsthe need of additional software controls to enhance the functionalitiesof the external device, thereby simplifying the user operation andenhancing user experience of the external device or the electronicdevice under various working modes.

FIG. 4 is a block diagram illustrating the structure of an electronicdevice an embodiment of the present disclosure. The electronic deviceincludes a second port 41 and a processor 42. The second port 41 may beused to connect to a first port of an external device. Processor 42 mayidentify a connection relationship from two or more candidate connectionrelationships between the first port and the second port in response todetecting a plug connect between the first port and the second port.Processor 42 may also identify a plurality of control commandscorresponding to the connection relationship based on the connectionrelationship, and respond to the control commands. Further, eachcandidate connection relationship corresponds to a different controlcommand.

The electronic device may include a second port, and the external devicemay include a first port. The first port may be a plug, and theelectronic device may be connected to the first port of the externaldevice through the second port so the electronic device and the externaldevice may be connected with one another. Further, the first port andthe second port may have two or more connection relationships.

Two or more potential connection relationships between the first portand the second port may be pre-stored as the two or more candidateconnection relationships. The candidate connection relationships may beused to identify the current connection relationship from the two ormore candidate connection relationships in response to detecting theplug connect between the first port and the second port.

The first port and the second port may be connected in two or morecandidate connection relationships. The two or more candidate connectionrelationships may be a plurality of connection parameters used toidentify the connection relationship. The connection parameters mayindicate the depth, angle, or position of the plug connect between thefirst port and the second port.

When the connection parameters indicate the depth of plug connectbetween the first port and the second port, different connectionparameters may indicate different depths of connection relationships.For example, when the first port is fully connected to the second port,it may be indicated as the first connection parameter. For example, thefirst port may be a plug, and the first port may be fully inserted intothe second port, at this point, the connection relationship correspondsto the first connection parameter may be the first candidate connectionrelationship. That is, the first port and the second port may be in thefirst candidate connection relationship. When the first port is notfully connected to the second port, it may be indicated as the secondconnection parameter. For example, the first port may be a plug, and thefirst port may not be fully inserted into the second port, such as whenthe first port is half-inserted into the second port. At this point, theconnection relationship corresponds to the second connection parametermay be the second candidate connection relationship. That is, the firstport and the second port may be in the second candidate connectionrelationship.

When the connection parameters indicate the angle of the plug connectbetween the first port and the second port, different connectionparameters may indicate different angles of connection relationships.For example, take a predetermined side of the first port from a firstend to a second end as a first reference direction, and a predeterminedside of the second port from a first end to a second end as a secondreference direction. When the angle between the first referencedirection and the second reference direction is 0°, the connectionrelationship between the first port and the second may be the firstcandidate connection relationship. When the angle between the firstreference direction and the second reference direction is 180°, theconnection relationship between the first port and the second may be thesecond candidate connection relationship. For example, the first portmay be a Type C plug, the second port may be a Type C port, and thefirst port may be connected through two or more angles. That is, thefirst surface of the first port and the second surface of the secondport may have two or more angles, such as forward insertion and reverseinsertion.

The plug connect between the first port and the second port in differentpositions may indicate different connection relationships, andconnection identifiers may be used to indicate the connectionrelationship where connection identifiers in different positions mayindicate different connection relationships. The second port may beconnected to the first port in a finite number of relative locations.Identify the relative location of the plug connect between the firstport and the second port may identify the connection relationshipcorresponding relative location of the connection of the two or morecandidate connection relationships.

For example, the first port may be a plug, the second port may be aslot, and the second port may be connected to the first port in a finitenumber of relative locations. Because the plug and slot of the existinguniversal 3.5 mm earphone may be rotated at any angle, the relativelocation is infinite. Due to the infinite number of angles or positions,the user cannot accurately insert the plug at a specified angle orposition. Therefore, the preferred port is a port with a finite numberof insertion positions.

On the basis of this understanding, the first port may be a Type A plugand the second port may be an unconventional Type A slot. The first portmay be inserted into the second port through forward and reverseinsertion. That is, the second port may be connected to the first portin two different relative locations. The first port may also be a microUSB plug, and the second port may be an unconventional micro USB slot.The first port may be inserted into the second port through forward andreverse insertion. Further, the first port may also be a Type C plug,and the second portion may be a Type C slot, and the second port may bebi-directionally connected to first port. Furthermore, the first portmay be a Lightening plug, the second port may be a Lightening slot, andthe second port may be bi-directionally connected to first port.

In one embodiment, the first port and the second port may be connectedin two or more connection relationships, and different connectionrelationships may correspond to different control commands. The two ormore connection relationships may correspond to two or more controlcommands; thereby avoid using software control to expand thefunctionalities of the external device.

For example, different connection surfaces may be distinguished bydifferent signs on the plug of the external device. For example, thefirst port of the external device may be a Type C plug. One surface ofthe Type C plug may be coated red and the other surface may be coatedblue to help user distinguish different connection relationships betweenthe first port and the second port.

The first port and the second port may be connected in two or morecandidate connection relationships, and different candidate connectionrelationships may correspond to different control commands. That is, thefirst port and the second port may be connected in a first connectionrelationship which corresponds to a first control command, or the firstport and the second port may be connected in a second connectionrelationship which corresponds to a second control command.

For example, when the connection relationship is identified to be thefirst connection relationship in the two or more candidate connectionrelationships, identify the first control command, where the firstcontrol command may place the electronic device or the external deviceunder a first working mode. Further, when the connection relationship isidentified to be the second connection relationship in the two or morecandidate connection relationships, identify the second control command,where the second control command may place the electronic device or theexternal device under a second working mode.

In one embodiment, every connection relationship may correspond to adifferent control command. When the connection relationship between thefirst port and the second port is the first connection relationship inthe two or more connection relationships, identify the first controlcommand based on the first connection relationship. When the connectionrelationship between the first port and the second port is the firstconnection relationship, the process may indicate the first controlcommand that need to be executed corresponding to the first connectionrelationship, respond to the first control command, and place theelectronic device or the external device under the first working mode.When the connection relationship between the first port and the secondport is the second connection relationship, the process may indicate thesecond control command that need to be executed corresponding to thesecond connection relationship, respond to the second control command,and place the electronic device or the external device under the secondworking mode.

In one embodiment, working modes may be the working modes of theelectronic device, the working modes of the external device, or theworking modes of both the electronic device and the external device.

In one embodiment, working modes may include power consumption modes,output modes, and may also include function modes.

For example, the first control command may place the electronic deviceunder a first power consumption mode, and the second control command mayplace the electronic device under a second power consumption mode; thefirst control command may place the electronic device under a firstoutput mode, and the second control command may place the electronicdevice under a second output mode; and the first control command mayplace the electronic device under a first function mode, and the secondcontrol command may place the electronic device under a second functionmode.

Further, the first control command may place the external device under afirst power consumption mode, and the second control command may placethe external device under a second power consumption mode; the firstcontrol command may place the external device under a first output mode,and the second control command may place the external device under asecond output mode; and the first control command may place the externaldevice under a first function mode, and the second control command mayplace the external device under a second function mode.

Furthermore, the first control command may place both the electronicdevice and the external device under a first power consumption mode, andthe second control command may place both the electronic device and theexternal device under a second power consumption mode; the first controlcommand may place both the electronic device and the external deviceunder a first output mode, and the second control command may place boththe electronic device and the external device under a second outputmode; and the first control command may place both the electronic deviceand the external device under a first function mode, and the secondcontrol command may place both the electronic device and the externaldevice under a second function mode.

The electronic device's working mode may be the power consumption mode,and the first port and the second port may be connected in the firstcandidate connection relationship. A power consumption device may switchfrom the first working mode to the second working mode after a firsttime period. Further, the first port and the second port may beconnected in the second candidate connection relationship. The powerconsumption device may switch from the first working mode to the secondworking mode after a second time period. The power consumption in thefirst working mode may be greater than the power consumption in thesecond working mode, and the first time period may be longer than thesecond time period.

For example, the power consumption device may be a monitor, and theexternal device may be a headset. The headset may connect to theelectronic through forward insertion, the monitor of the electronicdevice may stay lit for the first 2 minutes, then monitor may shut offafter 2 minutes. That is, the first port and the second port may beconnected in the first candidate connection relationship for 2 minutes,and the electronic device may switch from the first working mode to thesecond working mode. The headset may connect to the electronic throughreverse insertion, and the monitor of the electronic device may shut offimmediately. That is, the first port and the second port may beconnected in the second candidate connection relationship, and theelectronic device may directly switch to the second working mode.Compared with the first candidate connection relationship, theelectronic device connected to the headset in the second candidateconnection relationship may reduce the power consumption of the monitor.

The external device's working mode may be the power consumption mode,the first port and the second port may be connected in the firstcandidate connection relationship, and the external device may be placedunder a first power consumption mode. Further, the first port and thesecond port may be connected in the second candidate connectionrelationship, and the external device may be placed under a second powerconsumption mode. Furthermore, the power consumption in the first powerconsumption mode may be greater than the second power consumption mode.

For example, the external device may be a mobile power source, the firstport may be a plug, and the second port may be a slot. When plug isfully inserted into the slot, the mobile power source may fast chargethe electronic device, that is, the external device may be placed underthe first power consumption mode. Further, when the plug is not fullyinserted into the slot, for example, the plugs may be half-inserted orinserted 2/3 into the slot, the mobile power source may slow charge theelectronic device, that is, the external device may be placed under thesecond power consumption mode.

The electronic device's working mode may be the function mode, the firstport and the second port may be connected in the first candidateconnection relationship, and the electronic device may be under a firstfunction mode. Further, the first port and the second port may beconnected in the second candidate connection relationship, and theelectronic device may be under a second function mode.

For example, the external device may be a data cable, and the electronicdevice may be a mobile phone. When the first port is connected to thesecond port through forward insertion, the external device may chargethe electronic device and maintain the brightness of the monitor of theelectronic device. When the first port is connected to the second portthrough reverse insertion, the external may transmit data to theelectronic device and the monitor of the electronic device may shut off.

The electronic device and the external device's working mode may be thepower consumption mode, the first port and the second port may beconnected in the first candidate connection relationship, and theelectronic device and the external device may be under a first powerconsumption mode simultaneously. Further, the first port and the secondport may be connected in the second candidate connection relationship,and the electronic device and the external device and may be under asecond power consumption mode simultaneously. Furthermore, the powerconsumption in the first power consumption mode may be greater than thesecond power consumption mode.

For example, the external device may be a headset. When the first portis connected to a first second-port, the monitor of the electronicdevice may be in the high brightness mode, and the headset may be in thehigh volume mode. When the first port is connected to a secondsecond-port, the monitor of the electronic device may be in the lowbrightness mode, and the headset may be in the low volume mode.

The working modes may be the output modes.

In one embodiment, the external device may be a multimedia outputdevice, the first working mode may be the external device's first outputmode, and the second working mode may be external device's second outputmode.

In one embodiment, the multimedia output device may be a headset or adisplay. When the external device is a headset, its working modes mayinclude a first audio output mode, a second audio output mode, etc. Thefirst audio output mode may be an audio output mode that meets a firstaudio output condition where the first audio output condition may be thesurrounding sound less than 30 decibels, that is, the surrounding may bein a quite state, the audio output mode may be a mode that correspondsto the first audio output condition, such as a low volume mode. Further,the first audio output condition may be a condition where the audiotransmitted corresponds to the audio output of the external device,which may be soothing or intense. Further, the first audio outputcondition may be a output mode that strengthens the midrange and reducesthe treble and bass, and a second audio output condition may be a outputmode that strengthens the treble and lower the midrange and bass. Forexample, when making a call using the headset, the first audio outputmode may be used to enhance the frequency band in which the user isspeaking and reduce the sound of other frequency bands; when using theheadset to listen to music, the second audio output mode may be used toenhance the high-pitched music the user often listen to and reduce thebass and midrange music the user may not often listen to.

In one embodiment, the external device may be a display, and its workingmodes may include a first image output mode, a second image output mode,etc. The first image output mode may be a color image output mode, suchas when output a video or a picture. The second image output mode may bea black and white image output mode, such as when output a text documentor an electronic book. Alternatively, the image output mode may be amode that transmits images corresponding to the ambient lights orbrightness of the context of images being transmitted, such as whenplaying a horror movie, the first image output mode may be used totransmit darker images.

In one embodiment, the external device may be a multimedia acquisitiondevice, the first working mode may be a first acquisition mode, and thesecond working mode may be a second acquisition mode.

In one embodiment, the multimedia device may be a microphone or an imageacquisition device. The external device may be a microphone, and itsworking modes may include a first audio acquisition mode, a second audioacquisition mode, etc. For example, the first audio acquisition mode maybe a noise reduction acquisition mode, and the second audio acquisitionmode may be a non-noise reduction acquisition mode.

In one embodiment, the external device may be an image acquisitiondevice and its working modes may include a first image acquisition mode,a second image acquisition mode, etc. For example, the first imageacquisition mode may be a high saturation acquisition mode, the secondimage acquisition mode may be a low saturation acquisition mode, etc.

In one embodiment, the external device may be a headset, which may be adevice with a microphone and an earphone, and its working mode, and itsworking modes may include a first working mode for voice sound effectwith noise reduction, and a second working mode for musical sound effectwithout noise reduction.

In one embodiment, the external device may be a storage device, theelectronic device's first working mode may be a mode with a first readaccess, and its second working mode may be a mode with a second readaccess. For example, the first working mode may be a working mode thatallows the external device to access all data, and the second workingmode may be a working mode that allows the external device to accesspartial non-critical data. The electronic device may further include athird working mode where the third working mode a working mode that doesnot allow the external device to access any data. For example, the firstport may need to be inserted into 3 second ports in a predeterminedsequence to prevent unauthorized users from stealing data fromelectronic devices.

Further, the external device's first working mode may be a working modethat allows the electronic device to access data in the external device,and the second working mode may be a working mode that does not allowthe electronic device to access data in the external device. Theelectronic device may only access data in the external device when thefirst port and the second port are connected in the first connectionrelationship to prevent illegal access of data from the external device.

In one embodiment, the external device may be a storage device, theelectronic device's first working mode may be a mode with a first writeaccess, and its second working mode may be a mode with a second writeaccess. For example, the first working mode may be a working mode thatallows the external device to write data, and the second working modemay be a working mode that does not allow the external device to writedata. The external device may only write data into the electronic devicewhen the first port and the second port are connected in the firstconnection relationship to prevent the electronic device when from virusattacks.

In one embodiment, the external device's first working mode may be aworking mode that allows the electronic device to write data into theexternal device, and its second working mode may be a working mode thatdoes not allow the electronic device to write data into the externaldevice. The electronic device may only write data into the externaldevice when the first port and the second port are connected in thefirst connection relationship to prevent the external device when fromvirus attacks.

In one embodiment, when the electronic device or external device isunder the second working mode and the connection relationship matchesthe first connection relationship, upon receiving a second mode switchinstruction to switch the electronic device or external device from thesecond working mode to the first working mode, the electronic device orthe external device may respond to the second mode switch instruction.Further, when the electronic device or external device is under thefirst working mode and the connection relationship matches the secondconnection relationship, upon receiving a first mode switch instructionto switch the external device or electronic device from the firstworking mode to the second working mode, the electronic device or theexternal device may respond to the second mode switch instruction.

That is, when the electronic device or the external device is under thesecond working mode, the connection relationship of the electronicdevice or the external device may switch from the second connectionrelationship to the first connection relationship, and the electronicdevice or the external may switch from the second working mode to thefirst working mode based on the second mode switch instruction. Further,when the electronic device or the external device is under the firstworking mode, the connection relationship of the electronic device orthe external device may switch from the first connection relationship tothe second connection relationship, and the electronic device or theexternal may switch from the first working mode to the second workingmode based on the first mode switch instruction.

In one embodiment, upon receiving a first mode switch instruction toswitch the external device or electronic device from the first workingmode to the second working mode, and the connection relationship matchesthe first connection relationship, the electronic device or the externaldevice may respond to the first mode switch instruction. Further, uponreceiving a second mode switch instruction to switch the external deviceor electronic device from the second working mode to the first workingmode, and the connection relationship matches the second connectionrelationship, the electronic device or the external device may respondto the second mode switch instruction.

For example, the external device may be a display device, the firstconnection relationship may correspond to a first image output mode, andthe second connection relationship may correspond to a second imageoutput mode. While the external device and the electronic device areunder the first connection relationship, video files may be transmittedthrough the external device and the electronic device. Upon thecompletion of the output of the video files, when text files need to betransmitted, the second mode switch instruction may be used to switchthe working mode. Further, while the external device and the electronicdevice are under the second connection relationship, text files may betransmitted through the external device and the electronic device. Uponthe completion of the output of the text files, when video files need tobe transmitted, the first mode switch instruction may be used to switchthe working mode.

In one embodiment, while the connection relationship is the firstconnection relationship, and the first port and the second port areconnected in the first connection relationship, when a first request isreceived to place the electronic device or the external device under thefirst working mode with adjusted parameters, the parameters in the firstworking mode may be adjusted based on the first request. Upon completingthe data output corresponding to the first request, the parametersadjusted under the first working mode may be adjusted to the originalparameters.

In one embodiment, the electronic device or the external device mayrespond to a first command that may be identified based on the firstconnection relationship when the first port and the second port areconnected in the first connection relationship. When the first port andsecond are in connection relationships other than the first connectionrelationship, the connection relationships other than the firstconnection relationship may correspond to invalid control commands orhave no corresponding control commands, the connection relationshipsother than the first connection relationship may be invalid connections,and do not need to be responded.

In one embodiment, identifying a connection relationship from two ormore candidate connection relationships between the first port and thesecond port may be based on a one-time plug connect between the firstport and the second port, or a sequence of a plurality of connectionswithin a timeframe between the first port and the second port.

In one embodiment, the two or more candidate connection relationshipsmay include a one-time plug connect between the first port and thesecond port. For example, the first port and the second port only needto connect once to establish the connection relationship, and theworking mode may be identified based on the established connectionrelationship.

In one embodiment, the two or more candidate connection relationshipsmay include a sequence of connection relationships obtained from aplurality of connections within a timeframe between the first port andthe second port. For example, the first port and the second port mayconnect two or more times within a timeframe, the first connect may be afirst connection relationship, the second connect may be a secondconnection relationship, the third connect may be a third connectionrelationship, and no more subsequent change in connection relationshipafterward. Accordingly, the connection sequence obtained may be thefirst connection relationship→the second connection relationship→thefirst connection relationship. Different connection sequences maycorrespond to different control commands; hence correspond to differentworking modes.

In one embodiment, the plurality of connections within a timeframe maybe completing all the connections within the timeframe. Further,identification of the connection relationship sequence may be based on atime interval between 2 connections. When the connection relationshipdoes not change in the time interval, the sequence may be consideredcomplete.

Furthermore, the plurality of connections within a timeframe may be thatthe first port and the second port need to complete two or moreconnections within the timeframe in sequence. For example, the secondport may include a first second-port, a second second-port, and a thirdsecond-port. The first port may connect to the first, second, and thirdsecond-port, and connect to the last second port within the timeframe tocorrespond to a first working mode.

In one embodiment, identifying a connection relationship from two ormore candidate connection relationships between the first port and thesecond port may include identifying a resistance level at the plugconnect between the first port and the second port, and identifying theconnection relationship from two or more candidate connectionrelationships based on the resistance level.

The first port and the second port may have two or more candidateconnection relationships, and different candidate connectionrelationships may be identified based on the resistance level at theplug connect between the first port and the second port. That is, thecorresponding candidate connection relationship may be identified basedon different resistance levels at the plug connect between the firstport and the second port that may be connected at different angles ordifferent depths.

For example, the first port may be a Type C plug, the second port may bea Type C slot, and the resistance level at the plug connect between thefirst port and the second port may be different depending on whether theconnection is achieved through forward insertion or reverse insertion.

Further, the connection relationship may be identified from two or morecandidate connection relationships based on the relative location of theplug connect between the first port and the second port. Differentrelative connection positions may correspond to different connectionrelationships, hence, different control commands.

For example, a plurality of sensors may be placed by the connection ofthe second port, and data from different number of sensors maycorrespond to different connection relationships, or data from theplurality of sensors in different positions may correspond to differentconnection relationships.

The embodiments of the electronic device described above may identify aconnection relationship from two or more candidate connectionrelationships between a first port of an external device and a secondport of an electronic device in response to a processor detecting a plugconnect between the first port and the second port; identify a pluralityof control commands corresponding to the connection relationship; andrespond to the control commands. The identification of connectionrelationship between the external device and the electronic device, andthe control commands corresponding to the connection relationship avoidsthe need of additional software controls to enhance the functionalitiesof the external device, thereby simplifying the user operation andenhancing user experience of the external device or the electronicdevice under various working modes.

FIG. 5 is a block diagram illustrating the structure of a processingapparatus according to an embodiment of the present disclosure. Theprocessing apparatus includes a connection identification unit 51, acontrol command identification unit 52, and a response unit 53.

The connection identification unit 51 may be used to identify aconnection relationship, from two or more candidate connectionrelationships, that matches a plug connect between the first port andthe electronic device port, in response to detecting a plug connectbetween the first port and the second port.

The control command identification unit 52 may be used to identify aplurality of control commands corresponding to the connectionrelationship based on the connection relationship. Further, eachcandidate connection relationship corresponds to a different controlcommand.

The response unit 53 may be used to respond to the control command.

The processing apparatus disclosed in the above embodiments is based onthe processing method and the electronic device disclosed in theforegoing embodiments, and the details will not be described here.

The embodiments of the electronic device described above may identify aconnection relationship, from two or more candidate connectionrelationships, that matches a plug connect between the first port andthe electronic device port, in response to detecting a plug connectbetween the first port and the second port; identify a plurality ofcontrol commands corresponding to the connection relationship; andrespond to the control commands. The identification of connectionrelationship between the external device and the electronic device, andthe control commands corresponding to the connection relationship avoidsthe need of additional software controls to enhance the functionalitiesof the external device, thereby simplifying the user operation andenhancing user experience of the external device or the electronicdevice under various working modes.

The embodiments in this specification are described in a progressivemanner, each embodiment emphasizes a difference from the otherembodiments, and the identical or similar parts between the embodimentsmay be made reference to each other. Since the apparatuses disclosed inthe embodiments are corresponding to the methods disclosed in theembodiments, the description of the apparatuses is simple and relevantparts may be made with reference to the description of the methods.

Persons skilled in the art may further realize that, units and steps ofalgorithms according to the description of the embodiments disclosed bythe present disclosure can be implemented by electronic hardware,computer software, or a combination of the two. In order to describeinterchangeability of hardware and software clearly, compositions andsteps of the embodiments are generally described according to functionsin the forgoing description. Whether these functions are executed byhardware or software depends upon specific applications and designconstraints of the technical solutions. Persons skilled in the art mayuse different methods for each specific application to implement thedescribed functions, and such implementation should not be construed asa departure from the scope of the present disclosure.

The steps of the methods or algorithms described in the embodiments ofthe present disclosure may be directly implemented by hardware, softwaremodules executed by the processor, or a combination of both. Thesoftware module can be placed in a random access memory (RAM), memory,read only memory (ROM), electrically programmable ROM, electricallyerasable and programmable ROM, register, hard disk, mobile disk, CD-ROM,or any other form of storage medium known to the technical domain.

It will be understood by those skilled in the art that the featuresdescribed in the respective embodiments and/or claims of the presentdisclosure can be combined in various ways, even when such combinationsare not explicitly described in the present disclosure. In particular,without departing from the spirit and teaching of the presentdisclosure, the features described in the respective embodiments and/orclaims can be combined in various ways. All of these combinations fallwithin the scope of the present disclosure.

While the present disclosure has been shown and described with referenceto various embodiments thereof, it will be understood by those skilledin the art that various modifications in form and details may be madetherein without departing from the spirit and scope of the presentdisclosure as defined by the appended claims and their equivalents.Therefore, the scope of the present disclosure should not be limited tothe above-described embodiments but should be determined by not only theappended claims but also the equivalents thereof.

It should be noted that the description of the foregoing embodiments ofthe electronic device may be similar to that of the foregoing methodembodiments, and the device embodiments have the same beneficial effectsas those of the method embodiments. Therefore, details may not bedescribed herein again. For technical details not disclosed in theembodiments of the electronic device of the present disclosure, thoseskilled in the art may understand according to the method embodiments ofthe present disclosure.

In the several embodiments provided in the present disclosure, it shouldbe understood that the disclosed device and method may be realized inother manners. The device embodiments described above are merelyexemplary. All functional modules or units in the embodiments of thepresent disclosure may all be integrated in one processing unit, or eachunit may be used as a single unit. Two or more units may be integratedin one. The above integrated unit can either be implemented in the formof hardware, or in the form of hardware combined with softwarefunctional units.

Persons of ordinary skill in the art should understand that, all or apart of steps of implementing the foregoing method embodiments may beimplemented by related hardware of an computer instruction program. Theinstruction program may be stored in a computer-readable storage medium,and when executed, a processor executes the steps of the above methodembodiments as stated above. The foregoing storage medium may includevarious types of storage media, such as a removable storage device, aread only memory (ROM), a random-access memory (RAM), a magnetic disk,or any media that stores program code.

Alternatively, when the above-mentioned integrated units of the presentdisclosure are implemented in the form of a software functional modulebeing sold or used as an independent product, the integrated unit mayalso be stored in a computer-readable storage medium. Based on thisunderstanding, the technical solutions provided by the embodiments ofthe present disclosure essentially or partially may be embodied in theform of a software product stored in a storage medium. The storagemedium stores instructions which are executed by a computer device(which may be a personal computer, a server, a network device, or thelike) to realize all or a part of the embodiments of the presentdisclosure. The above-mentioned storage medium may include various mediacapable of storing program codes, such as a removable storage device, aread only memory (ROM), a random-access memory (RAM), a magnetic disk,or an optical disk.

Logic when implemented in software, can be written in an appropriatelanguage such as but not limited to C# or C++, and can be stored on ortransmitted through a computer-readable storage medium (e.g., that isnot a transitory signal) such as a random access memory (RAM), read-onlymemory (ROM), electrically erasable programmable read-only memory(EEPROM), compact disk read-only memory (CD-ROM) or other optical diskstorage such as digital versatile disc (DVD), magnetic disk storage orother magnetic storage devices including removable thumb drives, etc.

As disclosed, the present disclosure provides a processing method andprocessing apparatus, and an electronic device. The method includesidentifying a connection relationship, from two or more candidateconnection relationships, that matches a plug connect between a firstport of an external device and a second port of an electronic device, inresponse to detecting a plug connect between the first port and thesecond port; based on the connection relationship, identifying a controlcommand corresponding to the connection relationship, each candidateconnection relationship corresponding to a different control command;and responding to the control command. The identifications of connectionrelationship between the external device and the electronic device, andthe control commands corresponding to the connection relationship avoidthe need of additional software controls to enhance the functionalitiesof the external device, thereby simplifying the user operation andenhancing user experience of the external device and the electronicdevice under various working modes.

The foregoing descriptions are merely embodiments of the presentdisclosure, and the protection scope of the present disclosure is notlimited thereto. The scope that anyone skilled in the art may easilyconceive changes and substitutions within the technical scope disclosedin the present disclosure that should be covered by the presentdisclosure. Therefore, the protection scope of the present disclosureshould be subject to the scope of the claims as listed in the following.

Other embodiments of the disclosure will be apparent to those skilled inthe art from consideration of the specification and practice of thedisclosure provided herein. It is intended that the specification andexamples be considered as exemplary only, with a true scope and spiritof the disclosure being indicated by the claims.

What is claimed is:
 1. A processing method, comprising: in response todetecting a plug connect between a first port of an external device anda second port of an electronic device, identifying, from two or morecandidate connection relationships between the first port and the secondport, a connection relationship that matches the plug connect based on aplurality of connection parameters, wherein the plurality of connectionparameters characterize a depth of the plug connect; based on theconnection relationship, identifying a control command corresponding tothe connection relationship, wherein each candidate connectionrelationship corresponds to a different control command; and respondingto the control command.
 2. The method according to claim 1, whereinidentifying the control command corresponding to the connectionrelationship further includes: identifying a first control command whenthe connection relationship is a first connection relationship of thetwo or more candidate connection relationships, wherein the firstcontrol command is used to place the external device or the electronicdevice under a first working mode; and identifying a second controlcommand when the connection relationship is a second connectionrelationship of the two or more candidate connection relationships,wherein the second control command is used to place the external deviceor the electronic device under a second working mode.
 3. The methodaccording to claim 1, wherein identifying the connection relationshipcomprises: identifying the connection relationship from the two or morecandidate connection relationships after one-time plug connect betweenthe first port and the second port.
 4. The method according to claim 1,wherein the plurality of connection parameters further characterize anangle or a position of the plug connect between the first port and thesecond port.
 5. The method according to claim 1, wherein: the pluralityof connection parameters further characterize a resistance level at theplug connect between the first port and the second port.
 6. The methodaccording to claim 1, wherein: the second port is capable of being plugconnected at a plurality of different relative locations, identifyingthe connection relationship further includes: identifying, from theplurality of different relative locations, a relative location of theplug connect between the first port and the second port; andidentifying, from the two or more candidate connection relationships,the connection relationship further based on the relative location. 7.The method according to claim 2, further comprising: in response to theexternal device or the electronic device being under the second workingmode and the connection relationship being the first connectionrelationship, receiving a first mode switch instruction to switch theexternal device or the electronic device from the second working mode tothe first working mode; and responding to the first mode switchinstruction; or in response to the external device or the electronicdevice being under the first working mode and the connectionrelationship being the second connection relationship, receiving asecond mode switch instruction to switch the external device or theelectronic device from the first working mode to the second workingmode; and responding to the second mode switch instruction.
 8. Themethod of claim 2, wherein: the external device is a multimediaacquisition device, the first working mode is a first acquisition mode,and the second working mode is a second acquisition mode.
 9. Anelectronic device, comprising: an electronic device port capable ofconnecting to a first port on an external device; and a processor,configured to: in response to detecting a plug connect between the firstport of the external device and the electronic device port of anelectronic device, identify, from two or more candidate connectionrelationships between the first port and the electronic device port, aconnection relationship that matches the plug connect based on aplurality of connection parameters, wherein the plurality of connectionparameters characterize a depth of the plug connect; identify a controlcommand corresponding to the connection relationship, each candidateconnection relationship corresponding to a different control command;and respond to the control command.
 10. A processing apparatus,comprising: at least one processor, configured to: in response todetecting a plug connect between a first port of an external device anda second port of an electronic device, identify, from two or morecandidate connection relationships between the first port and the secondport, a connection relationship that matches the plug connect based on aplurality of connection parameters, wherein the plurality of connectionparameters characterize a depth of the plug connect; identify a controlcommand corresponding to the connection relationship, each candidateconnection relationship corresponding to a different control command;and respond to the control command.
 11. The method according to claim 1,wherein identifying the connection relationship comprises: identifying asequence of a plurality of connection relationships after a plurality ofplug connects within a pre-set timeframe between the first port and thesecond port.
 12. The method according to claim 2, wherein: the externaldevice is a multimedia output device, the first working mode is a firstoutput mode, and the second working mode is a second output mode. 13.The method according to claim 2, wherein: the external device is astorage device, the first working mode is a mode having a first readaccess, and the second working mode is a mode having a second readaccess.
 14. The method according to claim 2, wherein: the externaldevice is a storage device, the first working mode is a mode having afirst write access, and the second working mode is a mode having asecond write access.
 15. The method according to claim 2, wherein: theexternal device is a power source configured to charge the electronicdevice, the first working mode is a mode having a first charging speed,and the second working mode is a mode having a second charging speed.16. The method according to claim 2, wherein: the external device is adata cable, the first working mode is a charging mode, and the secondworking mode is a data transmission mode.
 17. The method according toclaim 16, wherein: the electronic device includes a monitor; abrightness of the monitor is maintained in the first working mode; andthe monitor is turned off in the second working mode.